<template>
  <div class="pull-to-refresh">
    <van-pull-refresh :value="refreshing" @refresh="onRefresh">
      <van-list
        :value="loading"
        :finished="finished"
        finished-text="没有更多了"
        offset="10"
        :immediate-check="false"
        @load="onLoad"
      >
        <slot></slot>
      </van-list>
    </van-pull-refresh>
  </div>
</template>

<script>

export default {
  components: {
  },
  data() {
    return {
      // loading: false,
      // refreshing: false,
    };
  },
  props: {
    loading: {
      type: Boolean,
      default: false
    },
    finished: {
      type: Boolean,
      default: false
    },
    refreshing: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    onload() {
      this.$emit('onload')
    },
    onRefresh() {
      this.$emit('onRefresh')
    }
  }
}
</script>

<style lang="less" scoped>
  .van-list {
    padding-bottom: 50px;
  }
</style>